package org.jash.mvp2206.news;

import org.jash.mvp2206.entity.AllCategory;
import org.jash.mvp2206.entity.DetailEntity;
import org.jash.mvp2206.entity.NewsPage;
import org.jash.mvp2206.entity.TopHot;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;

public final class Construct {
    public interface INewsModel {
        Observable<NewsPage> getNewsPage(int type, int page, int size);
    }
    public interface INewsPresenter {
        void getNewsPage(int type, int page, int size);
    }
    public interface INewsView {
        void newsPageSuccess(NewsPage.DataBean bean);
        void failure(Throwable t);
    }
    public interface INewsCategoryModel {
        Observable<AllCategory> getAllCategories();
        Observable<TopHot> getTopHot();
    }
    public interface INewsCategoryPresenter {
        void getAllCategories();
        void getTopHot();
    }
    public interface INewsCategoryView {
        void allCategoriesSuccess(List<AllCategory.DataBean> categories);
        void topHotSuccess(List<TopHot.DataBean> news);
        void failure(Throwable t);
    }

    public interface IDetailModel {
        Observable<DetailEntity> getNewsDetail(int id);
    }
    public interface IDetailPresenter {
        void getNewsDetail(int id);
    }
    public interface IDetailView {
        void loadDetailSuccess(DetailEntity.DataBean bean);
        void failure(Throwable t);
    }
}
